package com.zhuzl.orderservice.api.order;


import com.zhuzl.orderservice.api.consts.ServiceNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = ServiceNameConstants.SERVER_ORDER)
public interface OrderApi {

    /**
     * 创建订单
     *
     * @param productId 商品id
     * @param count     数量
     * @param hasError  是否产生错误
     * @return 结果
     */
    @PostMapping("/order/create")
    String createOrder(@RequestParam("productId") Integer productId,
                       @RequestParam("count") Integer count,
                       @RequestParam(value = "hasError", defaultValue = "false") Boolean hasError);

}
